Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#886) Add support for more arguments in packages.config #2504

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

TheCakeIsNaOH
Copy link
Member

@TheCakeIsNaOH TheCakeIsNaOH commented Jan 5, 2022

Description Of Changes

This adds the remaining arguments in the install command's OptionSet and some more arguments in the global OptionSet as elements to the packages.config xml serialization schema.

Motivation and Context

This is useful for users wanting arguments that were previously not
available. It is also a pre-requisite for exporting remembered
arguments, as some of the remembered arguments were not available
in the previous available schema.

Some of the global arguments were not added:

  • debug
  • verbose
  • trace
  • nocolor
  • noop
  • allowunofficial
  • proxy
  • proxy-user
  • proxy-password
  • proxy-bypass-list
  • proxy-bypass-on-local
  • log-file

All of these appeared to either not be applicable to a single package (e.g. proxy related) or required earlier than the packages.config would get read (like log-file).

Testing

Save this as a packages.config file:

<?xml version="1.0" encoding="utf-8"?>
<packages>
   <package id="iperf2" prerelease="true" overrideArguments="true"
     notSilent="true" allowDowngrade="true" forceDependencies="true"
     skipAutomationScripts="true" user="string" password="string" cert="string"
     certPassword="string" ignoreChecksums="true" allowEmptyChecksums="true" 
     allowEmptyChecksumsSecure="true" requireChecksums="true" 
     downloadChecksum="string" downloadChecksum64="string" 
     downloadChecksumType="sha512" downloadChecksumType64="sha512"
     ignorePackageExitCodes="true" usePackageExitCodes="true"
     stopOnFirstFailure="true" exitWhenRebootDetected="true"
     ignoreDetectedReboot="true" disableRepositoryOptimizations="true"
     acceptLicense="true" confirm="true" limitOutput="true" cacheLocation="Z:\"
     failOnStderr="true" useSystemPowershell="true" noProgress="true"
   />
</packages>

Set the debugging arguments as install \path\to\packages.config

Then set a breakpoint at get_packages_from_config in ChocolateyPackageService, and step through the method, ensuring that the settings in the packageConfig get updated correctly.

Change Types Made

  • Bug fix (non-breaking change)
  • Feature / Enhancement (non-breaking change)
  • Breaking change (fix or feature that could cause existing functionality to change)

Related Issue

Fixes #886
Depends on #2187

Change Checklist

  • Requires a change to the documentation
  • Documentation has been updated (Tracked in Document packages.config schema docs#403)
  • Tests to cover my changes, have been added
  • All new and existing tests passed.
  • N/A PowerShell v2 compatibility checked

@TheCakeIsNaOH
Copy link
Member Author

TheCakeIsNaOH commented Jan 5, 2022

There are three big todos left on this:

  • Have others look at the arguments I included (and did not), and see if there are any changes with regard to them.
  • Once that is done, then documentation needs to be updated (perhaps a list of all the support parameters?).
  • This needs to be properly tested (pending checking the arguments included and not).

@TheCakeIsNaOH TheCakeIsNaOH force-pushed the packages-config-all-options branch from afbad9f to 75617fd Compare March 6, 2022 05:11
@TheCakeIsNaOH TheCakeIsNaOH mentioned this pull request Mar 6, 2022
7 tasks
@TheCakeIsNaOH TheCakeIsNaOH force-pushed the packages-config-all-options branch from 75617fd to ee32006 Compare March 9, 2022 16:29
@TheCakeIsNaOH TheCakeIsNaOH force-pushed the packages-config-all-options branch from ee32006 to 8511938 Compare March 21, 2022 16:14
@TheCakeIsNaOH TheCakeIsNaOH force-pushed the packages-config-all-options branch from 8511938 to 2e400c9 Compare June 27, 2022 15:15
@coveralls
Copy link

coveralls commented Jun 27, 2022

Coverage Status

Coverage remained the same at 28.715% when pulling 35d9254 on TheCakeIsNaOH:packages-config-all-options into 2139d2a on chocolatey:develop.

@gep13 gep13 force-pushed the packages-config-all-options branch from 2e400c9 to d9eb80a Compare August 11, 2022 20:41
This adds the remaining arguments in the install command's OptionSet
as elements to the packages.config xml serialization schema.

This is useful for users wanting arguments that were previously not
available. It is also a pre-requisite for exporting remembered
arguments, as some of the remembered arguments were not available
in the previous available schema.
@gep13 gep13 force-pushed the packages-config-all-options branch from d9eb80a to 35d9254 Compare August 11, 2022 20:52
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13
Copy link
Member

gep13 commented Aug 11, 2022

@TheCakeIsNaOH this looks amazing! Thank you for getting all of these added! I will get this merged once the CI builds finish up.

@gep13 gep13 merged commit 3535232 into chocolatey:develop Aug 11, 2022
@TheCakeIsNaOH TheCakeIsNaOH deleted the packages-config-all-options branch August 11, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packages.config should include all options (including ignorechecksums)
3 participants